package com.c6906.vdam.das.model.entity;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import tech.spiro.addrparser.common.Point;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class EWVehiclesIllegalParking {
    private Date startTime;
    private Date endTime;
    private Long duration;
    private BigDecimal parkLon;
    private BigDecimal parkLat;
    private BigDecimal useUnitLon;
    private BigDecimal useUnitLat;
    private String parkAddr;
    private String useUnitAddr;
    private BigDecimal offsetDistance;

    public EWVehiclesIllegalParking(TerminalDMData terminalDMData, Point point) {
        this.startTime = DateUtil.parse(terminalDMData.getTerminalTime());
        this.parkLon = terminalDMData.getLongitude();
        this.parkLat = terminalDMData.getLatitude();
        this.useUnitLon = BigDecimal.valueOf(point.getLon());
        this.useUnitLat = BigDecimal.valueOf(point.getLat());
    }
}
